<template>
  <div class="main">
<el-container style="height: 100vh; ">
  <el-aside width="200px" style="background-color: rgb(238, 241, 246)">
    <el-menu router :default-openeds="openeds" unique-opened default-active="$route.path" active-text-color="skyblue">
      <el-submenu index="1">
        <template slot="title"><i class="el-icon-message"></i>试题管理</template>
        <el-menu-item-group>
          <template slot="title">科目</template>
          <el-menu-item index="/subjects/edit">新建科目</el-menu-item>
          <el-menu-item index="/subjects/list">科目管理</el-menu-item>
        </el-menu-item-group>
        <el-menu-item-group title="试题">
          <el-menu-item index="/tests/edit">新建试题</el-menu-item>
          <el-menu-item index="/tests/list">试题管理</el-menu-item>
        </el-menu-item-group>
      </el-submenu>
      <el-submenu index="2">
        <template slot="title"><i class="el-icon-menu"></i>成绩管理</template>
          <el-menu-item-group>
          <template slot="title">学生</template>
          <el-menu-item index="/student/list">学生账号管理</el-menu-item>
          <el-menu-item index="/answer/edit">学生成绩批改</el-menu-item>
          <el-menu-item index="/answer/list">学生成绩管理</el-menu-item>
        </el-menu-item-group>
      </el-submenu>
      <el-submenu index="3">
        <template slot="title"><i class="el-icon-setting"></i>系统设置</template>
        <el-menu-item-group>
          <template slot="title">分类</template>
          <el-menu-item index="/categories/edit">新建分类</el-menu-item>
          <el-menu-item index="/categories/list">分类管理</el-menu-item>
        </el-menu-item-group>
        <el-menu-item-group title="管理员">
          <el-menu-item index="/adminUser/edit">新建管理员</el-menu-item>
          <el-menu-item index="/adminUser/list">管理员分类</el-menu-item>
        </el-menu-item-group>
      </el-submenu>
    </el-menu>
  </el-aside>
  
  <el-container>
    <el-header style="text-align: right; font-size: 12px">
<el-dropdown @command="handleCommand">
  <span class="el-dropdown-link">
   <i class="el-icon-setting" style="margin-right: 5px"></i>
  </span>
  <el-dropdown-menu slot="dropdown">
    <el-dropdown-item command="a">退出登录</el-dropdown-item>
 
  </el-dropdown-menu>
</el-dropdown>
      <span>yibing</span>
    </el-header>
    <el-main>
   <router-view></router-view>
    </el-main>
   
  </el-container>
</el-container>
  </div>
</template>

<script>
export default {
 data() {
   return {
      openeds: ['1']
   }
    },
    methods: {
      handleCommand() {
        this.$router.push('/login')
    }
    },
}
</script>

<style>
  .el-header {
    background-color: #B3C0D1;
    color: #333;
    line-height: 60px;
  }
  
  .el-aside {
    color: #333;
  }
   .el-dropdown-link {
    cursor: pointer;
    vertical-align: middle;
  }
  .el-icon-arrow-down {
    font-size: 12px;
  }
</style>